package cn.wh.ymcc.mq;


import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.client.producer.SendStatus;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class MediaFIleProducer {
    @Autowired
    private RocketMQTemplate rocketMQTemplate;


    public boolean sendMessagePush(String courseName){
        SendResult sendResult = rocketMQTemplate.syncSend("media-topic:media-tags", courseName);
        SendStatus sendStatus = sendResult.getSendStatus();
        System.out.println("发送成功");
        return sendStatus==SendStatus.SEND_OK;
    }

}